<?php
	/**
	* Currency save
	* @author: trungdt
	* @since: Oct 14, 2011
	* @version: 1.0
	* 
	* Change logs
	* 
	*/

	if (!defined('EXPONENT')) exit('');
	
	if (exponent_permissions_check(array("administrate"), $loc)){
		$cur = null;
		if (!empty($_POST['id'])) {
			$cur = $db->selectObject('productsmodule_currency', 'id='.intval($_POST['id']));
		}

		$cur = productsmodule_categories::currency_update($_POST, $cur);
		if (isset($cur->id)) {
			$db->updateObject($cur,'productsmodule_currency');
		} else {
			$db->insertObject($cur,'productsmodule_currency');
		}

		exponent_flow_redirect();
	}
?>